<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%--
  Created by IntelliJ IDEA.
  User: xiangyinjie
  Date: 2021/5/10
  Time: 19:11
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>Title</title>
    <%
        //获取项目的根路径
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<%=basePath%>/layui-v2.6.6/css/layui.css"  media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>/sweetalert.css">
    <script type="text/javascript" src="<%=basePath%>/sweetalert-dev.js"></script>
</head>
<body>
<form method="post" action="<%=basePath%>borrow">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
        <legend>借书记录</legend>
    </fieldset>
    <table class="layui-table" lay-skin="line">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>读者名称</th>
            <th>书籍名称</th>
            <th>借书时间</th>
            <th>约定天数</th>
            <th>联系电话</th>
        </tr>
        </thead>
        <tbody>
        <c:if test="${page!=null}">
        <c:forEach items="${page.list}" var="borrow">
            <tr  >

                <td>${borrow.cardName}</td>
                <td>${borrow.bookName}</td>
                <td>${borrow.startTime}</td>
                <td>${borrow.day}</td>
                <td>${borrow.phone}</td>
            </tr>
        </c:forEach>
        </c:if>
        </tbody>
    </table>
<%--    <c:if test="${requestScope.pageborrow.currentPage!=1}">--%>
<%--        <a href="<%=basePath%>BorrowServlet?curr=1"><button type="button" class="layui-btn layui-btn-sm">首页</button></a>--%>
<%--    </c:if>--%>
<%--    <c:if test="${requestScope.pageborrow.currentPage>1}">--%>
<%--        <a href="<%=basePath%>BorrowServlet?curr=${requestScope.pageborrow.currentPage-1}"> <button type="button" class="layui-btn layui-btn-sm">上一页</button></a>--%>
<%--    </c:if>--%>
<%--   ${requestScope.pageborrow.currentPage}${requestScope.pageborrow.totalPage}--%>
<%--    <c:if test="${requestScope.pageborrow.currentPage<requestScope.pageborrow.totalPage}">--%>
<%--        <a href="<%=basePath%>BorrowServlet?curr=${requestScope.pageborrow.currentPage+1}"><button type="button" class="layui-btn layui-btn-sm">下一页</button></a>--%>
<%--    </c:if>--%>
<%--    <c:if test="${requestScope.pageborrow.currentPage!=requestScope.pageborrow.totalPage}">--%>
<%--        <a href="<%=basePath%>BorrowServlet?curr=${requestScope.pageborrow.totalPage}"><button type="button" class="layui-btn layui-btn-sm">尾页</button></a>--%>
<%--    </c:if>--%>
    </div>
</form>
<script src="<%=basePath%>/layui-v2.6.6/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=basePath%>/jquery-1.12.4.js"></script>
</body>
</html>

